<template>
  <div class="home-container">
    <van-swipe class="my-swipe" :autoplay="5000" indicator-color="white">
      <van-swipe-item>
        <img src="https://img0.baidu.com/it/u=906980944,3572524897&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=447" alt="">
      </van-swipe-item>
      <van-swipe-item>
        <img src="https://img2.baidu.com/it/u=4047127918,1639814130&fm=253&fmt=auto&app=138&f=JPEG?w=714&h=500" alt="">
      </van-swipe-item>
    </van-swipe>
    <van-grid :gutter="10" style="margin-top: 7px">
      <van-grid-item icon="balance-o" text="加油记账" to="/oilEnter" />
      <van-grid-item icon="logistics" text="车辆保养" to="/carKeep" />
      <van-grid-item v-if="role == 'admin'" icon="todo-list-o" text="出单记录" to="/issue" />
    </van-grid>
  </div>
</template>

<script>
export default {
  name: 'HomeIndex',
  components: {},
  props: {},
  data () {
    return {
      role: null
    }
  },
  computed: {},
  watch: {},
  created () {
    // this.role = this.$store.state.user.role
    this.role = 'admin'
  },
  mounted () {},
  methods: {}
}
</script>

<style scoped lang="scss">
// .my-swipe .van-swipe-item {
//   color: #fff;
//   font-size: 20px;
//   line-height: 150px;
//   text-align: center;
//   background-color: #39a9ed;
// }
img {
  width: 100%;
  height: 200px;
}
</style>
